'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: 2_study_over_add.py
* @Time: 2025/7/13
* @All Rights Reserve By Brtc
'''
from sys import prefix


#1、定义一个Person 类
#2、Person 类的加法规则是， 名字相加   财产相加
#3、大家如果有时间 可以 自己  去重载 一个 |   重载方法是__or__
class Person:
    def __init__(self, name:str, moeny:int):
        self.m_name = name
        self.m_money = moeny

    def __add__(self, other):
        return Person(self.m_name +"___"+ other.m_name, self.m_money + other.m_money)

    def intro(self):
        print(f"我的名字叫:{self.m_name} , 我的财产是{self.m_money}")

zhangsan = Person("zhangsan", 10)
zhangsan.intro()
wangwu = Person("wangwu", 20)
wangwu.intro()

add_person = zhangsan + wangwu
add_person.intro()